package com.it.flowable.dto;

import lombok.Data;
import org.flowable.task.api.Task;

import java.util.*;

@Data
public class TaskInfoVo {
    private String id;
    private String name;
    private String assignee;
    private String processInstanceId;
    private String processDefinitionId;
    private Date createTime;
    private Map<String, Object> variables;

    private List<FormInfoDto> forms = new ArrayList<>();
    private List<String> listeners = new ArrayList<>();
    private List<String> taskListeners = new ArrayList<>();
    private Map<String, Object> customExtensions = new HashMap<>();

    // 构造函数
    public TaskInfoVo(Task task, Map<String, Object> variables) {
        this.id = task.getId();
        this.name = task.getName();
        this.assignee = task.getAssignee();
        this.processInstanceId = task.getProcessInstanceId();
        this.processDefinitionId = task.getProcessDefinitionId();
        this.createTime = task.getCreateTime();
        this.variables = variables;
    }
}